import re

# 判断用户输入的内容是否是数字，如果是的话，转化成数字类型
while True:
    s = input('please enter string:')
    if re.fullmatch(r'\d*\.?\d*', s) is not None:
        print(float(s))
    else:
        print('your input contains something other than number')
